{% extends "./inc/base.html" %} {% block content %}

<section class="vbox">
    <header class="header bg-light dk">
        <p>{{controller.meta_title}}</p>
    </header>
    <section class="scrollable wrapper">
        <section class="panel panel-default">
            <header class="panel-heading">
                {{controller.meta_title}}
            </header>
            <div class="row wrapper" style="padding-bottom: 0">
                <div class="col-sm-12 m-b-xs">
                    <P>
                        Ping++ 集成微信、支付宝、银联等主流第三方支付渠道，提供包括商户入网申请、交易处理和支付运营的一站式服务。<br>
                        如果您还没有ping++账号请 <a href="https://www.pingxx.com/" target="_blank"
                                           class="text-info">申请Ping++账号</a>
                    </P>
                    <ul class="list-group no-radius m-b-none m-t-n-xxs list-group-lg no-border">
                        <li class="list-group-item">
                            <a class=" pull-left m-r-sm" href="https://www.pingxx.com/" target="_blank">
                                <img class="" src="/static/admin/img/pingxx/logo.png">
                            </a>
                            <P class="clear">
                                <strong class="block m-b-xs appid">App_ID:{% if app_id %}
                                    <small><code>{{app_id}}</code> <a data-toggle="ajaxModal"
                                                                                href="/admin/ecom/addappid"
                                                                                class="text-info">修改</a></small>
                                    {% else %}
                                    <small><a class="btn btn-info btn-xs" data-toggle="ajaxModal"
                                              href="/admin/ecom/addappid">添加 App_ID</a></small>
                                    {%endif%}
                                    <span class="text-muted " style="font-size: 12px;font-weight: 400"> 用于在 Ping++
                                        系统中标识你的应用
                                    </span>
                                </strong>
                                <strong class="block m-b-xs LiveSecretKey">Live Secret Key:{% if livesecretkey %}
                                    <small><code>{{livesecretkey}}</code> <a data-toggle="ajaxModal"
                                                                                href="/admin/ecom/addlivesecretkey"
                                                                                class="text-info">修改</a></small>
                                    {% else %}
                                    <small><a class="btn btn-info btn-xs" data-toggle="ajaxModal"
                                              href="/admin/ecom/addlivesecretkey">添加 Live Secret Key</a></small>
                                    {%endif%}
                                    <span class="text-muted " style="font-size: 12px;font-weight: 400"> Server 端真实交易密钥
                                    </span>
                                </strong>
                                <strong class="block m-b-xs RSA">商户私钥:
                                    <small><code>cmswing_rsa_private_key.pem</code> <a data-toggle="ajaxModal"
                                                                             href="/admin/ecom/rsa/?type=private"
                                                                             class="text-info">配置</a></small>

                                    <span class="text-muted " style="font-size: 12px;font-weight: 400"> 生产 RSA 公私钥对，<a href="https://help.pingxx.com/article/123161" target="_blank" class="text-info">如何生成？</a>，
                                        或者 <a href="http://web.chacuo.net/netrsakeypair" target="_blank" class="text-info"> 用在线生成RSA 公私钥对</a> 公私钥对生成后，把私钥填此处，公钥填到PING++后台。
                                    </span>
                                </strong>
                                <strong class="block m-b-xs RSA">Ping++ 公钥:
                                    <small><code>pingpp_rsa_public_key.pem</code> <a data-toggle="ajaxModal"
                                                                                       href="/admin/ecom/rsa/?type=public"
                                                                                       class="text-info">配置</a></small>

                                    <span class="text-muted " style="font-size: 12px;font-weight: 400"> 在 Ping++ 后台>账号和设置 找到 Ping++ 公钥 填到此处。
                                    </span>
                                </strong>
                                <strong class="block webhokks">Webhooks:
                                    <small> <a data-toggle="ajaxModal"
                                                                                       href="/admin/ecom/webhokks"
                                                                                       class="btn btn-info btn-xs">查看接收 URL</a></small>
{#
                                    <span class="text-muted " style="font-size: 12px;font-weight: 400"> 生产 RSA 公私钥对，<a href="https://help.pingxx.com/article/123161" target="_blank" class="text-info">如何生成？</a>，
                                        或者 <a href="http://web.chacuo.net/netrsakeypair" target="_blank" class="text-info"> 用在线生成RSA 公私钥对</a> 公私钥对生成后，把私钥填此处，公钥填到PING++后台。
                                    </span>
                                    #}
                                </strong>
                            </P>
                        </li>

                    </ul>
                    <h4 class="text-success m-b-xs">支付渠道: <small>{% if config.setup.PREPAID == 0 %}<code>支持预付款消费</code>{%else%}<code>不支持预付款消费</code>{%endif%} ,
                        {% if config.setup.COD == 0 %}<code>支持货到付款</code>{%else%}<code>不支持货到付款</code>{%endif%}
                    如要更改，请到 系统设置>网站设置>商城 <a href="/admin/setup/index?id=5" class="text-info">设置</a>
                    </small></h4>
                </div>

            </div>
            <header class="panel-heading text-right bg-light">
                <ul class="nav nav-tabs pull-left">
                    <li class="active"><a data-toggle="tab" href="#pay1"><i class="fa fa-desktop text-muted"></i> 适用于 PC
                        网页 </a></li>
                    <li class=""><a data-toggle="tab" href="#pay2"><i class="fa fa-mobile text-muted"></i> 适用于手机网页 </a>
                    </li>
                    <li class=""><a data-toggle="tab" href="#pay3"><i class="fa fa-apple text-muted"></i> 适用于 App </a>
                    </li>
                </ul>
                <span class="hidden-sm">Left</span>
            </header>
            <div class="tab-content">
                <div class="tab-pane active" id="pay1">
            <div class="table-responsive">
                <table class="table hover b-t b-light">
                    <thead>
                    <tr><th>支付名称</th><th>支付频道</th><th>描述</th><th>状态</th><th>操作</th></tr>
                    </thead>
                    <tbody>
                    {% for item in channel %}
                    {% if item.type == 1%}
                    <tr>

                        <td><img src="{{item.logo}}" > {{ item.title }}
                        </td>
                        <td>{{item.channel}}</td>
                        <td>{{item.info|safe}}</td>
                        <td>
                            <a href="/admin/ecom/setstatus/?ids={{item.id}}&status={{1-item.status}}&table=pingxx"
                               class="active ajax-get" data-toggle="class">
                                <i class="fa fa-check text-success {%if item.status %}text-active{%else%}text{%endif%}"></i>
                                <i class="fa fa-times text-danger {%if item.status %}text{%else%}text-active{%endif%}"></i>
                            </a>
                        </td>
                        <td>

                            {%if item.status == 0%}
                            <a href="/admin/ecom/setstatus/?ids={{item.id}}&status={{1-item.status}}&table=pingxx"
                               class="ajax-get text-success">启用</a>
                            {%else%}
                            <a href="/admin/ecom/setstatus/?ids={{item.id}}&status={{1-item.status}}&table=pingxx"
                               class="ajax-get text-danger">禁用</a>
                            {%endif%}

                        </td>
                    </tr>
                    {%endif%}
                    {% endfor %}

                    </tbody>

                </table>
            </div>
                </div>
                <div class="tab-pane " id="pay2">
                    <div class="table-responsive">
                        <table class="table hover b-t b-light">
                            <thead>
                            <tr><th>支付名称</th><th>支付频道</th><th>描述</th><th>状态</th><th>操作</th></tr>
                            </thead>
                            <tbody>
                            {% for item in channel %}
                            {% if item.type == 2%}
                            <tr>

                                <td><img src="{{item.logo}}" > {{ item.title }}
                                </td>
                                <td>{{item.channel}}</td>
                                <td>{{item.info|safe}}</td>
                                <td>
                                    <a href="/admin/ecom/setstatus/?ids={{item.id}}&status={{1-item.status}}&table=pingxx"
                                       class="active ajax-get" data-toggle="class">
                                        <i class="fa fa-check text-success {%if item.status %}text-active{%else%}text{%endif%}"></i>
                                        <i class="fa fa-times text-danger {%if item.status %}text{%else%}text-active{%endif%}"></i>
                                    </a>
                                </td>
                                <td>

                                    {%if item.status == 0%}
                                    <a href="/admin/ecom/setstatus/?ids={{item.id}}&status={{1-item.status}}&table=pingxx"
                                       class="ajax-get text-success">启用</a>
                                    {%else%}
                                    <a href="/admin/ecom/setstatus/?ids={{item.id}}&status={{1-item.status}}&table=pingxx"
                                       class="ajax-get text-danger">禁用</a>
                                    {%endif%}

                                </td>
                            </tr>
                            {%endif%}
                            {% endfor %}

                            </tbody>

                        </table>
                    </div>
                </div>
                <div class="tab-pane " id="pay3">
                    <div class="table-responsive">
                        <table class="table hover b-t b-light">
                            <thead>
                            <tr><th>支付名称</th><th>支付频道</th><th>描述</th><th>状态</th><th>操作</th></tr>
                            </thead>
                            <tbody>
                            {% for item in channel %}
                            {% if item.type == 3%}
                            <tr>

                                <td><img src="{{item.logo}}" > {{ item.title }}
                                </td>
                                <td>{{item.channel}}</td>
                                <td>{{item.info|safe}}</td>
                                <td>
                                    <a href="/admin/ecom/setstatus/?ids={{item.id}}/status/{{1-item.status}}/table/pingxx"
                                       class="active ajax-get" data-toggle="class">
                                        <i class="fa fa-check text-success {%if item.status %}text-active{%else%}text{%endif%}"></i>
                                        <i class="fa fa-times text-danger {%if item.status %}text{%else%}text-active{%endif%}"></i>
                                    </a>
                                </td>
                                <td>

                                    {%if item.status == 0%}
                                    <a href="/admin/ecom/setstatus/?ids={{item.id}}&status={{1-item.status}}&table=pingxx"
                                       class="ajax-get text-success">启用</a>
                                    {%else%}
                                    <a href="/admin/ecom/setstatus/?ids={{item.id}}&status={{1-item.status}}&table=pingxx"
                                       class="ajax-get text-danger">禁用</a>
                                    {%endif%}

                                </td>
                            </tr>
                            {%endif%}
                            {% endfor %}

                            </tbody>

                        </table>
                    </div>
                </div>
            </div>

        </section>
    </section>
</section>

{% endblock %}
{% block script%}
<script>
    $(function () {
        $(document).on("click", '.addappid', function (e) {
            var val = $("input[name='appid']").val();
            if (val.length == 0) {
                swal("appid不能为空");
                return false;
            }
            $.ajax({
                url: "/admin/ecom/addappid",
                type: "POST",
                data: {appid: val},
                success: function (res) {
                    if (res.errno == 0) {
                        var html = '<code >' + val + '</code> <a class="text-info"  data-toggle="ajaxModal" href="/admin/ecom/addappid">修改</a>'
                        $('strong.appid>small').html(html);
                        $('#ajaxModal').modal('hide');
                        toastr.success(res.data.name);
                    } else {
                        toastr.error(res.errmsg);
                    }
                }
            })
        })

        $(document).on("click", '.addlivesecretkey', function (e) {
            var val = $("input[name='livesecretkey']").val();
            if (val.length == 0) {
                swal("livesecretkey不能为空");
                return false;
            }
            $.ajax({
                url: "/admin/ecom/addlivesecretkey",
                type: "POST",
                data: {livesecretkey: val},
                success: function (res) {
                    if (res.errno == 0) {
                        var html = '<code >' + val + '</code> <a class="text-info"  data-toggle="ajaxModal" href="/admin/ecom/addlivesecretkey">修改</a>'
                        $('strong.LiveSecretKey>small').html(html);
                        $('#ajaxModal').modal('hide');
                        toastr.success(res.data.name);
                    } else {
                        toastr.error(res.errmsg);
                    }
                }
            })
        })
        $(document).on("click", '.edit_rsa', function (e) {
            var val = $("textarea[name='rsa']").val();
            var type = $("input[name='type']").val();
           // alert(type);return false;
            if (val.length == 0) {
                swal("livesecretkey不能为空");
                return false;
            }
            $.ajax({
                url: "/admin/ecom/rsa",
                type: "POST",
                data: {rsa: val,type:type},
                success: function (res) {
                    if (res.errno == 0) {
                       // var html = '<code >' + val + '</code> <a class="text-info"  data-toggle="ajaxModal" href="/admin/ecom/addlivesecretkey">修改</a>'
                        //$('strong.LiveSecretKey>small').html(html);
                        $('#ajaxModal').modal('hide');
                        toastr.success(res.data.name);
                    } else {
                        toastr.error(res.errmsg);
                    }
                }
            })
        })
    })
</script>
{% endblock%}